/*=============================================================================

  UI.VIEW.MAIN

  FILE: UIvw_main.cpp
  
  DESCRIPTION

    UI.VIEW.MAIN

  EXTERNALIZED FUNCTIONS


   Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

  EDIT HISTORY

  ---------  -------  -------------------------------------------------------
    when       who       what, where, why
  ---------  -------  -------------------------------------------------------
   03/14/04   nso4th    Initial version

=============================================================================*/

/*=============================================================================
  HEADER INCLUSION
=============================================================================*/
#include <mainView.h>

/*=============================================================================
  SYSTEM ERROR DEFINITION
=============================================================================*/

/*=============================================================================
  EXTERNALIZED FUNCION DEFINITION
=============================================================================*/
void vwMain_Create(boolean enable)
{
	CMainView		*vw = (CMainView*)ObjList_Get(VIEW_MAIN);
	Vmain			*gv;
	RECT			rc;
	int32			w, h;
	int32			wx, wy, ww, wh;
	
	if(vw == NULL)
		return;

	gv = &vw->m_vMain; // Main view

	vw->GetClientRect(&rc);
	w = rc.right - rc.left;
	h = rc.bottom - rc.top;

	if(enable)
	{
		// Main view
		wx = 0;
		wy = 0;
		ww = w;
		wh = h-(UIsize_TBL(UISIZE_TITLE_H)+UIsize_TBL(UISIZE_LOG_H));
		gv->WindowCreate("", wx, wy, ww, wh, GC_WND_CHILD, vw);
		gv->ShowWindow(SW_HIDE);
		ObjList_Set(VIEW_VMAIN, (mcxt)gv);
	}
	else
	{
		gv->DestroyWindow();
		ObjList_Set(VIEW_VMAIN, NULL);
	}
}

void vwMain_Show(boolean enable)
{
	CMainView		*vw = (CMainView*)ObjList_Get(VIEW_MAIN);
	Vmain			*gv;
	int32			mode;
	
	if(vw == NULL)
		return;

	gv = &vw->m_vMain; // Main view

	if(enable)
	{
		mode = SW_NORMAL;
	}
	else
	{
		mode = SW_HIDE;
	}
	gv->ShowWindow(mode);
}

/*--- END OF UIvw_main.cpp ---*/
